<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>一闪一闪亮晶晶</title>
    <style>
        .star {
            width: 100px;
            height: 100px;
            margin: 100px auto;
            background-image: url(../star-sprite.png);
            animation: star .5s infinite steps(28);
        }

        .bike {
            width: 130px;
            height: 130px;
            margin: 300px auto;
            background-image: url(../bike.png);
            animation: bike .7s infinite steps(31);
        }

        @keyframes bike {
            from {
                background-position: 0 0;
            }

            to {
                background-position: 0 -4030px;
            }
        }

        @keyframes star {
            from {
                background-position: 0 0;
            }

            to {
                background-position: -2800px 0;
            }
        }
    </style>
</head>

<body>
    <div class="star"></div>
    <div class="bike"></div>
</body>

</html>